package com.lucy.flow.controller;

import com.lucy.common.domain.ResponseDTO;
import com.lucy.flow.params.FlowDefineCreateParams;
import com.lucy.flow.utils.XmlUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("flow")
@Api(tags = "流程定义")
public class FlowDefineController {

    /**
     * 采用文件上传 xml body携带必须参数
     * @return
     * @throws DocumentException
     */
    @PostMapping(value = "define")
    @ApiOperation(value = "流程定义新增",notes = "")
    public ResponseDTO<Object> flowDefineCreate() throws DocumentException {
//        System.out.println(params.getFlowDefine());
//        Document document = XmlUtil.string2Document(params.getFlowDefine());
//        return ResponseDTO.succData(params.getFlowDefine());
        return null;
    }
}
